package com.xbdun.web.validatebmp.controller.code;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.xbdun.web.validatebmp.utils.code.VeriCodeUtil;

/**
* @ClassName: VeriCodeController
* @Description	验证码
* @author zhanggt 360730440@qq.com
* @date 2017年5月1日 下午4:05:48
*/
@Controller
public class VeriCodeController extends BaseVeriCodeController{

	@Autowired
	StringRedisTemplate stringRedisTemplate;
	/**
	* @Title: veriCode
	* @Description 生成验证码图片
	* @param request		HTTP
	* @param response		HTTP
	* @param veriCode		Session键KEY
	* @throws IOException    设定文件
	* @return void    返回类型
	 */
	@RequestMapping(value = "veriCode", method = {RequestMethod.GET,RequestMethod.POST})
    public void veriCode(HttpServletResponse response,@RequestParam("veriCode")String veriCode){
		VeriCodeUtil.printCode(stringRedisTemplate,response,veriCode,4, 70,25);
    }
}
